<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@include file="../../common/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<%@include file="../../common/common-css.jsp" %>
<%@include file="../../common/common-js.jsp" %>
<link href="${pageContext.servletContext.contextPath }/css/style.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.servletContext.contextPath }/js/js.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.servletContext.contextPath }/js/jquery.js"></script>
<link href="${pageContext.servletContext.contextPath }/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.servletContext.contextPath }/css/fenyecss.css" />
	<style type="text/css">
	  input{font-size: 12px}
	</style>
	<script type="text/javascript">
     function getLabelList(){
    	var uplabel = $("#ptypeId").val();
    	if(uplabel!=null&&uplabel!=0){
    	$.ajax({url:"${pageContext.servletContext.contextPath }/background/serviceProvider/searchTypeList.html?pid="+uplabel,
		   type:"post",
		   cache:"false",
		   error : function() {
			   alert("系统繁忙，请稍后再试！");
			},
		   success:function(msg){
			   $("#typeId").html(msg);
		   }
		});
    	}else{
    		$("#typeId").html('<select name="typeId" id="type_Id"><option value="0">请选择</option></select>');
    	}
    }
    </script>
</head>
<body>
<form id="fenye" name="fenye" action="${pageContext.servletContext.contextPath }/background/serviceProvider/query.html" method="post">
<div class="right" >
        	<div class="volume">
            	<img src="${pageContext.servletContext.contextPath }/images/toleft.png" style="margin:23px 0 0 2px;_margin:23px 0 0 0px;" />
            </div>
        	<div class="rightcon ">
            	<div class="title">
                	您当前的位置：首页 > 服务商管理 > 服务商列表
                </div>
                <input type="hidden" name="pageNow" id="pageNow"/>
                <table border="0" cellpadding="0" cellspacing="0" class="table1">
                	<tr>
                    	<td class="odd">运营商名称：
                        </td>
                        <td class="even"><input   type="text" class="input1" name="operatorname" value="${serviceProvider.operatorname }"/>
                        </td>
                        <td class="odd">类别名称：
                        </td>
                        <td class="even">
                        <select name="ptypeId"  id="ptypeId" onchange="getLabelList()">
								<option value="0">请选择</option>
											<c:forEach var="key" items="${serviceTypes}">
												<option value="${key.id}" <c:if test="${key.id eq serviceProvider.ptypeId}">selected="selected"</c:if>>${key.name}</option>
											</c:forEach>
						</select>
                        </td>
                         <td class="odd">子类别名称：
                        </td>
                        <td class="even" id="typeId">
						<select name="typeId" id="type_Id">
									<option value="0">请选择</option>
										<c:forEach var="key" items="${userviceTypes}">
												<option value="${key.id}" <c:if test="${key.id eq serviceProvider.typeId}">selected="selected"</c:if>>${key.name}</option>
											</c:forEach>
										</select>
                        </td>
                        <td class="odd"  rowspan="2"  >
                        	<input type="image" src="${pageContext.servletContext.contextPath }/images/cx.png" width="101" height="46"/>
                        </td>
                    </tr>
                    <tr>
                    	<td class="odd">服务商名称：
                        </td>
                        <td class="even"><input  type="text" class="input1" name="name" value="${serviceProvider.name }" />
                        </td>
                    </tr>
                </table>
                 <table border="0" cellpadding="0" cellspacing="0" class="table2">
                 	<tr class="title">
                        <td width="10%" align="center">
                        	运营商名称
                        </td>
                         <td width="10%" align="center">
                        	服务商名称
                        </td>
                        <td  width="5%" align="center">
                        	服务电话
                        </td>
                         <td width="10%" align="center">
                        	负责人姓名
                        </td>
                        <td width="10%" align="center">
                        	服务状态
                        </td>
                        <td width="30%" style=" border-right:none;" align="center">
                        	操作
                        </td>
                    </tr>
                    <c:forEach var="serviceProvider" items="${pageView.records}">
                    <tr class="odd">
                        <td align="center">
                        	${serviceProvider.operatorname}
                        </td>
                         <td align="center">
                        	${serviceProvider.name}
                        </td>
                        <td  align="center">
                        	${serviceProvider.telephone}
                        </td>
                         <td align="center">
                        	${serviceProvider.managerName}
                        </td>
                        <td align="center">
                        	<c:if test="${serviceProvider.servicestatus eq 'Y'}">
						服务
			             </c:if>
			             <c:if test="${serviceProvider.servicestatus eq 'N1'}">
			             当日停止服务
			             </c:if>
			             <c:if test="${serviceProvider.servicestatus eq 'N'}">
			            停止服务
			             </c:if>
                        </td>
                        <td  style=" border-right:none;" align="center">
                        	<sec:authorize ifAnyGranted="ROLE_serviceProvider_show">
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/getInfo.html?id=${serviceProvider.id}">
            	详情</a>
            	&nbsp;&nbsp;</sec:authorize>
            <sec:authorize ifAnyGranted="ROLE_serviceProvider_edit">
            <a href="${pageContext.servletContext.contextPath }/background/serviceProvider/getById.html?id=${serviceProvider.id}">
                                     编辑
            </a>
            &nbsp; &nbsp;</sec:authorize>
            <sec:authorize ifAnyGranted="ROLE_serviceProvider_delete">
            	<a href="javascript:void(0);" onclick="deleteId('${pageContext.servletContext.contextPath }/background/serviceProvider/deleteById.html?id=${serviceProvider.id}')">
            	删除</a>
            	</sec:authorize>
            	   <sec:authorize ifAnyGranted="ROLE_serviceProvider_updateStatus">
            	    <c:if test="${serviceProvider.servicestatus eq 'Y'}">
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/updateStatus.html?id=${serviceProvider.id}&&servicestatus=N1">
            	当日停止</a>
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/updateStatus.html?id=${serviceProvider.id}&&servicestatus=N">
            	停止服务</a>
             </c:if>
             <c:if test="${serviceProvider.servicestatus eq 'N1'}">
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/updateStatus.html?id=${serviceProvider.id}&&servicestatus=Y">
            	恢复服务</a>
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/updateStatus.html?id=${serviceProvider.id}&&servicestatus=N">
            	停止服务</a>
             </c:if>
             <c:if test="${serviceProvider.servicestatus eq 'N'}">
            	<a href="${pageContext.servletContext.contextPath }/background/serviceProvider/updateStatus.html?id=${serviceProvider.id}&&servicestatus=Y">
            	恢复服务</a>
             </c:if>
            	</sec:authorize>
            	 <sec:authorize ifAnyGranted="ROLE_serviceProvider_seeserviceuserandproject">
            <a href="${pageContext.servletContext.contextPath }/background/serviceProvider/seeserviceuserandproject.html?id=${serviceProvider.id}&&type=user">
                                    查看人员
            </a>
            <a href="${pageContext.servletContext.contextPath }/background/serviceProvider/seeserviceuserandproject.html?id=${serviceProvider.id}&&type=project">
                                    查看项目
            </a>
            &nbsp; &nbsp;</sec:authorize>
                        	
                        </td>
                    </tr>
                    </c:forEach>
                    <tr>
                    <%@include file="../../common/webfenye.jsp" %>
                    </tr>
                 </table>
                
            </div><!--rightcon-->
        </div>

</form>
</body>
</html>